class_name Controller_Input
extends ControllerBase

## 注册绑定KeyAction的事件
func register_key_action_event(callable:Callable):
	super(callable)
## 取消注册绑定KeyAction的事件
func unregister_key_action_event(callable:Callable):
	super(callable)
## 轮询检查KeyAction的事件
func check_process() -> bool:
	if not super():
		return false
	for key_action_str in GameEnum.KeyAction.keys():
		if not InputMap.has_action(key_action_str):
			continue
		if Input.is_action_just_pressed(key_action_str):
			key_action_state_changed.emit(GameEnum.KeyAction[key_action_str],GameEnum.KeyActionState.Pressed)
		if Input.is_action_just_released(key_action_str):
			key_action_state_changed.emit(GameEnum.KeyAction[key_action_str],GameEnum.KeyActionState.Released)
	return true
